#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,h1,h2,m1,m2,m,h;
	cin>>a>>b;
	h1=a/100;
	h2=b/100;
	m1=a%100+h1*60;
	m2=b%100+h2*60;
	m=m2-m1;
	h=m/60;
	m=m%60;
	if(h>1)
	printf("The train journey time is %d hours ",h);
	else 
	printf("The train journey time is %d hour ",h);
	if(m>1)
	printf("%d minutes.",m);
	else
	printf("%d minute.",m);
    return 0;
}

